﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TVLConversor
{
    class conversor
    {
        private const double pulg_mm = 25.4;
        private const double pies_cm = 30.48;
        private const double yardas_m = 0.914;
        private const double millas_km = 1.609;
        private const double mm_pulg = 0.039;
        private const double cm_pulg = 0.39;
        private const double m_yardas = 1.094;
        private const double km_millas = 0.62;
        private const double onza_g = 28.35;
        private const double libra_kg = 0.453;
        private const double g_onza = 0.035;
        private const double kg_libra = 2.2;

        public double pulgTomm(double pul)
        {
            return pul * pulg_mm;
        }

        public double pulgTocm(double pul)
        {
            return this.pulgTomm(pul) / 10;
        }

        public double pulgTom(double pul)
        {
            return this.pulgTocm(pul) / 100;
        }

        public double pulgTokm(double pul)
        {
            return this.pulgTom(pul) / 1000;
        }

        public double pulgToyarda(double pul)
        {
            return this.mToyarda(this.pulgTom(pul));
        }

        public double pulgTomilla(double pul)
        {
            return this.kmTomilla(this.pulgTokm(pul));
        }
        
        public double piesTocm(double pies)
        {
            return pies * pies_cm;
        }

        public double piesTomm(double pies)
        {
            return this.piesTocm(pies) * 10;
        }

        public double piesTom(double pies)
        {
            return this.piesTocm(pies) / 100;
        }

        public double piesTokm(double pies)
        {
            return this.piesTom(pies) / 1000;
        }

        public double piesTomilla(double pies)
        {
            return this.kmTomilla(this.piesTokm(pies));
        }

        public double piesToyarda(double pies)
        {
            return this.mToyarda(this.piesTom(pies));
        }

        public double piesTopulg(double pies)
        {
            return this.cmTopulg(this.piesTocm(pies));
        }

        public double yardasTom(double yard)
        {
            return yard * yardas_m;
        }

        public double yardasTocm(double yard)
        {
            return this.yardasTom(yard) * 100;
        }

        public double yardasTomm(double yard)
        {
            return this.yardasTocm(yard) * 10;
        }

        public double yardasTokm(double yard)
        {
            return this.yardasTom(yard) / 1000;
        }

        public double yardasTopulg(double yard)
        {
            return this.cmTopulg(this.yardasTocm(yard));
        }

        public double yardasTomilla(double yard)
        {
            return this.kmTomilla(this.yardasTokm(yard));
        }

        public double millasTokm(double mill)
        {
            return mill * millas_km;
        }

        public double millasTom(double mill)
        {
            return this.millasTokm(mill) * 1000;
        }

        public double millasTocm(double mill)
        {
            return this.millasTom(mill) * 100;
        }

        public double millasTomm(double mill)
        {
            return this.millasTocm(mill) * 10;
        }

        public double millasTopulg(double mill)
        {
            return this.cmTopulg(this.millasTocm(mill));
        }

        public double millasToyardas(double mill)
        {
            return this.mToyarda(this.millasTom(mill));
        }

        public double mmTopulg(double mm)
        {
            return mm * mm_pulg;
        }

        public double mmToyarda(double mm)
        {
            return this.mToyarda(this.mmTom(mm));
        }

        public double mmTomilla(double mm)
        {
            return this.kmTomilla(this.mmTokm(mm));
        }

        public double mmTocm(double mm)
        {
            return mm / 10;
        }

        public double mmTokm(double mm)
        {
            return this.mmTom(mm) / 1000;
        }

        public double mmTom(double mm)
        {
            return mm / 1000;
        }

        public double cmTopulg(double cm)
        {
            return cm * cm_pulg;
        }

        public double cmTom(double cm)
        {
            return cm / 100;
        }

        public double cmToyarda(double cm)
        {
            return this.mToyarda(this.cmTom(cm));
        }

        public double cmTomm(double cm)
        {
            return cm / 10;
        }

        public double cmTomilla(double cm)
        {
            return this.kmTomilla(this.cmTokm(cm));
        }

        public double cmTokm(double cm)
        {
            return this.cmTom(cm) / 1000;
        }

        public double mTopulg(double m)
        {
            return this.cmTopulg(this.mTocm(m));
        }

        public double mTocm(double m)
        {
            return m / 100;
        }

        public double mToyarda(double m)
        {
            return m * m_yardas;
        }

        public double mTokm(double m)
        {
            return m / 1000;
        }

        public double mTomm(double m)
        {
            return this.mTocm(m) / 10;
        }

        public double mTomilla(double m)
        {
            return this.kmTomilla(this.mTokm(m));
        }

        public double kmTopulg(double km)
        {
            return this.mTopulg(this.kmTom(km));
        }

        public double kmTom(double km)
        {
            return km * 1000;
        }

        public double kmToyarda(double km)
        {
            return this.mToyarda(this.kmTom(km));
        }

        public double kmTomm(double km)
        {
            return this.kmTom(km) * 1000;
        }

        public double kmTocm(double km)
        {
            return this.kmTom(km) * 100;
        }

        public double kmTomilla(double km)
        {
            return km * km_millas;
        }

        public double onzaTog(double onz)
        {
            return onz * onza_g;
        }

        public double onzaTokg(double onz)
        {
            return this.onzaTog(onz) / 1000;
        }

        public double onzaTolibra(double onz)
        {
            return this.gTolibra(this.onzaTog(onz));
        }

        public double onzaToton(double onz)
        {
            return this.kgToton(this.onzaTokg(onz));
        }

        public double libraTokg(double libr)
        {
            return libr * libra_kg;
        }

        public double libraTog(double libr)
        {
            return this.libraTokg(libr) * 1000;
        }

        public double libraToonz(double libr)
        {
            return this.libraTokg(this.kgToonza(libr));
        }

        public double libraToton(double libr)
        {
            return this.libraTokg(libr) / 1000;
        }

        public double gTokg(double g)
        {
            return g / 1000;
        }

        public double gTolibra(double g)
        {
            return this.kgTolibra(this.gTokg(g));
        }

        public double gToton(double g)
        {
            return this.kgToton(this.gTokg(g));
        }

        public double gToonza(double g)
        {
            return g * g_onza;
        }

        public double kgTog(double kg)
        {
            return kg * 1000;
        }

        public double kgToonza(double kg)
        {
            return this.gToonza(this.kgTog(kg));
        }

        public double kgTolibra(double kg)
        {
            return kg * kg_libra;
        }

        public double kgToton(double kg)
        {
            return kg / 1000;
        }

        public double tonTokg(double ton)
        {
            return ton * 1000;
        }

        public double tonTog(double ton)
        {
            return this.tonTokg(ton) * 1000;
        }

        public double tonToonza(double ton)
        {
            return this.kgToonza(this.tonTokg(ton));
        }

        public double tonTolibra(double ton)
        {
            return this.kgTolibra(this.tonTokg(ton));
        }

        public double celsToFaren(double c)
        {
            return c * 9 / 5 + 32;
        }

        public double farenToCels(double f)
        {
            return (f - 32) * 5 / 9;
        }
    }
}
